$(function(){

    $.get(contextPath+"/seller/order",function(data){
        data = $.parseJSON(data);
        var all = $('#allbody');
        var push = $('#pushbody');
        var pay = $('#paybody');
        var receive = $('#receivebody');
        var commit = $('#commitbody');
        $.each(data.list, function (i, item) {
            var temp = ' <tr>'+
                '<td scope="row" style="vertical-align: middle;">' +
                '<img src="'+contextPath+item.goods.index_url+'" style="height: 140px;width: 140px" class="img-thumbnail">'+
                '<p>'+item.goods.name+'</p></td>'+
                '<td style="vertical-align: middle;"><p>单价：'+item.goods.price+'</p>' +
                '<p>数量：'+item.amount+'</p>' +
                '<p>总价：'+item.price+'</p></td>'+
                '<td style="vertical-align: middle;">微信号：'+item.fans.weixing+
                '<p>留言：'+item.note+'</p>' +
                '<p>地址：'+item.addresses.fansAddress+'</p>' +
                '<p>电话：'+item.addresses.phone+'</p></td>'+
                '<td style="vertical-align: middle;">';
            if(item.order_status == 1){
                temp+='未支付</td></tr>';
            }
            else if(item.order_status == 3){
                temp+='待收货</td></tr>';

            }else if(item.order_status == 4){
                temp+='待评价</td></tr>';
            }else if(item.order_status == 5){
                temp+='已评价</td></tr>';
            }
            all.append(temp);
            if(item.order_status == 1){
                pay.append(temp)
            }
            else if(item.order_status == 3){
                push.append(temp);
            }else if(item.order_status == 4){
                receive.append(temp);
            }else if(item.order_status == 5){
                commit.append(temp);
            }
        })
    });
});